From: Florian Müllner Date: Thu, 6 Sep 2012 11:21:12 +0000 (+0200) Subject: sessionMode: Introduce the concept of "primary" modes X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5911 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8109dd684ed5ad92cabeeab58952b87a6b8a1362;p=gnome-shell.git sessionMode: Introduce the concept of "primary" modes With the recent session mode changes, there is now a mix of modes that are meant to apply to the entire session (specified as parameter to the --mode command line switch) and temporary modes like the lock screen; introduce a property to make the difference explicit, and only allow "primary" modes to be specified on the command line. https://bugzilla.gnome.org/show_bug.cgi?id=683488 --- diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js index 51fb6d615..27c81a89f 100644 --- a/js/ui/sessionMode.js +++ b/js/ui/sessionMode.js @@ -20,6 +20,7 @@ const _modes = { hasWindows: false, isLocked: false, isGreeter: false, + isPrimary: false, unlockDialog: null, components: [], panel: { @@ -32,6 +33,7 @@ const _modes = { 'gdm': { allowKeybindingsWhenModal: true, isGreeter: true, + isPrimary: true, unlockDialog: imports.gdm.loginDialog.LoginDialog, components: ['polkitAgent'], panel: { @@ -55,6 +57,7 @@ const _modes = { }, 'initial-setup': { + isPrimary: true, components: ['keyring'], panel: { left: [], @@ -73,6 +76,7 @@ const _modes = { hasWindows: true, unlockDialog: imports.ui.unlockDialog.UnlockDialog, isLocked: false, + isPrimary: true, components: ['networkAgent', 'polkitAgent', 'telepathyClient', 'keyring', 'recorder', 'autorunManager', 'automountManager'], panel: { @@ -87,7 +91,8 @@ const _modes = { function listModes() { let modes = Object.getOwnPropertyNames(_modes); for (let i = 0; i < modes.length; i++) - print(modes[i]); + if (_modes[modes[i]].isPrimary) + print(modes[i]); } const SessionMode = new Lang.Class({ @@ -95,7 +100,9 @@ const SessionMode = new Lang.Class({ _init: function() { global.connect('notify::session-mode', Lang.bind(this, this._sync)); - this._modeStack = [global.session_mode]; + let mode = _modes[global.session_mode].isPrimary ? global.session_mode + : 'user'; + this._modeStack = [mode]; this._sync(); },